home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / MorphOS / cvs-1.11.2 / source / amiga / ssh / ssh.h < prev   
Encoding:
C/C++ Source or Header  |  2002-11-18  |  5.4 KB  |  125 lines

  1. /*
  2.  * SSH constants and protocol structure
  3.  *
  4.  * $Id$
  5.  *
  6.  * :ts=4
  7.  */
  8.  
  9. #ifndef _SSH_H
  10. #define _SSH_H
  11.  
  12. /****************************************************************************/
  13.  
  14. #define INBUF_SIZE 32768        /* Input buffer size */
  15.  
  16. /****************************************************************************/
  17.  
  18. #define SSH_PORT 22
  19.  
  20. /****************************************************************************/
  21.  
  22. #define SSH_MSG_NONE                            0       /* no message */
  23. #define SSH_MSG_DISCONNECT                      1       /* cause (string) */
  24. #define SSH_SMSG_PUBLIC_KEY                     2       /* ck,msk,srvk,hostk */
  25. #define SSH_CMSG_SESSION_KEY                    3       /* key (MP_INT) */
  26. #define SSH_CMSG_USER                           4       /* user (string) */
  27. #define SSH_CMSG_AUTH_RHOSTS                    5       /* user (string) */
  28. #define SSH_CMSG_AUTH_RSA                       6       /* modulus (MP_INT) */
  29. #define SSH_SMSG_AUTH_RSA_CHALLENGE             7       /* int (MP_INT) */
  30. #define SSH_CMSG_AUTH_RSA_RESPONSE              8       /* int (MP_INT) */
  31. #define SSH_CMSG_AUTH_PASSWORD                  9       /* pass (string) */
  32. #define SSH_CMSG_REQUEST_PTY                    10      /* TERM, tty modes */
  33. #define SSH_CMSG_WINDOW_SIZE                    11      /* row,col,xpix,ypix */
  34. #define SSH_CMSG_EXEC_SHELL                     12      /* */
  35. #define SSH_CMSG_EXEC_CMD                       13      /* cmd (string) */
  36. #define SSH_SMSG_SUCCESS                        14      /* */
  37. #define SSH_SMSG_FAILURE                        15      /* */
  38. #define SSH_CMSG_STDIN_DATA                     16      /* data (string) */
  39. #define SSH_SMSG_STDOUT_DATA                    17      /* data (string) */
  40. #define SSH_SMSG_STDERR_DATA                    18      /* data (string) */
  41. #define SSH_CMSG_EOF                            19      /* */
  42. #define SSH_SMSG_EXITSTATUS                     20      /* status (int) */
  43. #define SSH_MSG_CHANNEL_OPEN_CONFIRMATION       21      /* channel (int) */
  44. #define SSH_MSG_CHANNEL_OPEN_FAILURE            22      /* channel (int) */
  45. #define SSH_MSG_CHANNEL_DATA                    23      /* ch,data (int,str) */
  46. #define SSH_MSG_CHANNEL_CLOSE                   24      /* channel (int) */
  47. #define SSH_MSG_CHANNEL_CLOSE_CONFIRMATION      25      /* channel (int) */
  48.  
  49. /* new channel protocol */
  50. #define SSH_MSG_CHANNEL_INPUT_EOF               24
  51. #define SSH_MSG_CHANNEL_OUTPUT_CLOSED           25
  52.  
  53. /*      SSH_CMSG_X11_REQUEST_FORWARDING         26         OBSOLETE */
  54. #define SSH_SMSG_X11_OPEN                       27      /* channel (int) */
  55. #define SSH_CMSG_PORT_FORWARD_REQUEST           28      /* p,host,hp (i,s,i) */
  56. #define SSH_MSG_PORT_OPEN                       29      /* ch,h,p (i,s,i) */
  57. #define SSH_CMSG_AGENT_REQUEST_FORWARDING       30      /* */
  58. #define SSH_SMSG_AGENT_OPEN                     31      /* port (int) */
  59. #define SSH_MSG_IGNORE                          32      /* string */
  60. #define SSH_CMSG_EXIT_CONFIRMATION              33      /* */
  61. #define SSH_CMSG_X11_REQUEST_FORWARDING         34      /* proto,data (s,s) */
  62. #define SSH_CMSG_AUTH_RHOSTS_RSA                35      /* user,mod (s,mpi) */
  63. #define SSH_MSG_DEBUG                           36      /* string */
  64. #define SSH_CMSG_REQUEST_COMPRESSION            37      /* level 1-9 (int) */
  65. #define SSH_CMSG_MAX_PACKET_SIZE                38      /* max_size (int) */
  66.  
  67. /* Support for TIS authentication server
  68.    Contributed by Andre April <Andre.April@cediti.be>. */
  69. #define SSH_CMSG_AUTH_TIS                       39      /* */
  70. #define SSH_SMSG_AUTH_TIS_CHALLENGE             40      /* string */
  71. #define SSH_CMSG_AUTH_TIS_RESPONSE              41      /* pass (string) */
  72.  
  73. /* Support for kerberos authentication by Glenn Machin and Dug Song
  74.    <dugsong@umich.edu> */
  75. #define SSH_CMSG_AUTH_KERBEROS                  42      /* string (KTEXT) */
  76. #define SSH_SMSG_AUTH_KERBEROS_RESPONSE         43      /* string (KTEXT) */
  77. #define SSH_CMSG_HAVE_KERBEROS_TGT              44      /* string (credentials) */
  78.  
  79. /* Reserved for official extensions, do not use these */
  80. #define SSH_CMSG_RESERVED_START                 45
  81. #define SSH_CMSG_RESERVED_END                   63
  82.  
  83. /****************************************************************************/
  84.  
  85. #define EMULATE_OLD_CHANNEL_CODE 0x0001
  86. #define EMULATE_OLD_AGENT_BUG    0x0002
  87.  
  88. #define EMULATE_VERSION_OK                      0
  89. #define EMULATE_MAJOR_VERSION_MISMATCH          1
  90. #define EMULATE_VERSION_TOO_OLD                 2
  91. #define EMULATE_VERSION_NEWER                   3
  92.  
  93. /****************************************************************************/
  94.  
  95. /* Major protocol version.  Different version indicates major incompatiblity
  96.    that prevents communication.  */
  97. #define PROTOCOL_MAJOR          1
  98.  
  99. /* Minor protocol version.  Different version indicates minor incompatibility
  100.    that does not prevent interoperation. */
  101. #define PROTOCOL_MINOR          5
  102.  
  103. /****************************************************************************/
  104.  
  105. #define SSH_CIPHER_NONE         0
  106. #define SSH_CIPHER_IDEA         1
  107. #define SSH_CIPHER_DES          2
  108. #define SSH_CIPHER_3DES         3
  109. #define SSH_CIPHER_RC4          5
  110. #define SSH_CIPHER_BLOWFISH     6
  111.  
  112. /****************************************************************************/
  113.  
  114. struct Packet
  115. {
  116.     long length;
  117.     int type;
  118.     unsigned char data[INBUF_SIZE];
  119.     unsigned char *body;
  120. };
  121.  
  122. /****************************************************************************/
  123.  
  124. #endif /* _SSH_H */
  125.